<template>
  <Header></Header>
  <Tab></Tab>
  <router-view :style="viewStyle" v-slot="{Component}">
    <keep-alive>
      <component :is="Component"></component>
    </keep-alive>
  </router-view>
  <router-view :style="viewStyle" v-slot="{Component}" name="user">
    <transition appear name="slide">
      <keep-alive>
        <component :is="Component"></component>
      </keep-alive>
    </transition>
  </router-view>
  <Player></Player>
</template>

<script>
import Header from '@/components/header/header.vue'
import Tab from '@/components/tab/tab.vue'
import Player from '@/components/player/player.vue'
import { mapState } from 'vuex'

export default {
  components: {
    Header,
    Tab,
    Player
  },
  computed: {
    viewStyle () {
      const bottom = this.playList.length ? '1.7rem' : '0'
      return {
        bottom
      }
    },
    ...mapState(['playList'])
  }
}
</script>

<style lang="scss"></style>
